home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 051a / tbav603.zip / TBUTIL.DOC < prev    next >
Text File  |  1993-06-15  |  22KB  |  721 lines

  1.  
  2.  
  3.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  4.  
  5.  
  6.                                Table of Contents
  7.  
  8.  
  9.     1. INTRODUCTION...................................... 2
  10.         1.1. Purpose of TbUtil........................... 2
  11.  
  12.     2. USAGE OF THE PROGRAM.............................. 4
  13.         2.1. System requirements......................... 4
  14.         2.2. Program invocation.......................... 4
  15.         2.3. Command line options........................ 4
  16.             2.3.1. immunize ............................. 4
  17.             2.3.2. store ................................ 5
  18.             2.3.3. compare .............................. 5
  19.             2.3.4. restore .............................. 5
  20.             2.3.5. norepeat ............................. 6
  21.             2.3.6. description .......................... 6
  22.             2.3.7. part ................................. 6
  23.             2.3.8. boot ................................. 6
  24.             2.3.9. cmos ................................. 6
  25.         2.4. Examples:................................... 7
  26.         2.5. Using the anti-virus partition.............. 7
  27.  
  28.     3. THE THUNDERBYTE PARTITION CODE.................... 8
  29.         3.1. What is a partition?........................ 8
  30.         3.2. What is a partition table?.................. 8
  31.         3.3. The partition code.......................... 8
  32.  
  33.     4. MISCELLANOUS INFORMATION......................... 11
  34.         4.1. Exit codes................................. 11
  35.         4.2. Recommendations............................ 11
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                      Page i
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.                                      Page 1
  122.  
  123.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  124.  
  125.  
  126. 1.  INTRODUCTION
  127.  
  128.  
  129.   1.1.  Purpose of TbUtil
  130.  
  131.     TbUtil has been developed as a tool to provide a defense against
  132.     partition table and bootsector viruses.
  133.  
  134.     -   It can save the partition table, bootsector and CMOS data area
  135.         to a file.
  136.  
  137.     -   It can compare and restore the partition table, bootsector and
  138.         CMOS data area after an (virus) accident.
  139.  
  140.     -   It can remove a partition table virus without having to
  141.         low-level format the hard disk, even if there is no backup of
  142.         the partition table.
  143.  
  144.     -   It can remove bootsector viruses.
  145.  
  146.     -   It can create a partition table that has some first-line virus
  147.         defense built-in.
  148.  
  149.     -   It can replace the infected or clean bootsector by a bootsector
  150.         which has advantages over the standard ones.
  151.  
  152.     Unlike most file viruses, partition table viruses are hard to
  153.     remove. The only solution is to low-level format the hard disk and
  154.     to make a new partition table, or to make use of undocumented DOS
  155.     commands.
  156.  
  157.     TbUtil makes a backup of the partition table and bootsector, and
  158.     this backup can be used to compare and restore the original
  159.     partition table and bootsector once they are infected. You don't
  160.     have to format your disk anymore to get rid of a partition table or
  161.     bootsector virus.  The program can also restore the CMOS
  162.     configuration.
  163.  
  164.     If your partition table is damaged and you don't have a backup of
  165.     it, TbUtil will try to create a new partition table, avoiding the
  166.     need of a low-level format.
  167.  
  168.     Another important feature is that you can use TbUtil to replace the
  169.     partition table code with it's own code which is more resistant
  170.     against viruses. The TbUtil partition code will be executed before
  171.     the bootsector gains control, so it is able to check the bootsector
  172.     in a clean environment. Once the bootsector is executed it is
  173.     difficult to check it, because the virus is already resident in
  174.     memory and can fool every protection. Instead of booting from a
  175.     clean DOS diskette just to inspect the bootsector, the TbUtil
  176.     partition code performs a CRC calculation on the bootsector just
  177.     before control is passed to it. If the bootsector has been modified
  178.  
  179.  
  180.  
  181.                                      Page 2
  182.  
  183.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  184.  
  185.  
  186.     the TbUtil partition code will warn you about this. The TbUtil
  187.     partition code also checks the RAM layout and informs you when it
  188.     is changed. It does this every time you boot from your hard disk.
  189.  
  190.     TbUtil can replace infected and clean bootsectors by a new
  191.     bootsector, which has advantages over the standard bootsector.  It
  192.     has bootsector virus detection capabilities, it performs a sanity
  193.     check, and it offers you the possibility to redirect the boot
  194.     process to the hard disk without opening the diskette drive door.
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.                                      Page 3
  242.  
  243.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  244.  
  245.  
  246. 2.  USAGE OF THE PROGRAM
  247.  
  248.  
  249.   2.1.  System requirements
  250.  
  251.     TbUtil should work on any machine with a working hard disk, and
  252.     with any DOS version.  The program requires only about 64Kb of free
  253.     RAM to execute.
  254.  
  255.  
  256.   2.2.  Program invocation
  257.  
  258.     The use of the program is very easy: just run TbUtil without
  259.     parameters to get a help screen.
  260.  
  261.     The syntax:
  262.                 TBUTIL <options>
  263.  
  264.  
  265.   2.3.  Command line options
  266.  
  267.     It is possible to specify options on the command line. TbUtil
  268.     recognizes option-characters and option-words. The words are
  269.     easier to remember, and they will be used in this manual for
  270.     convenience.
  271.  
  272.     optionword  parameter short  explanation
  273.     ----------  --------- ---- -------------------------------------
  274.     immunize <drive>       im  = Immunize/Clean boot/MBR of <drive>
  275.     store    [<filename>]  st  = Store system information
  276.     restore  [<filename>]  re  = Restore system information
  277.     compare  [<filename>]  co  = Compare system information
  278.         Sub-options of option 'Immunize':
  279.     norepeat               nr  = Do not ask for next diskette
  280.         Sub-options of option 'Store':
  281.     description =<descr.>  de  = Add description to data file
  282.         Sub-options of option 'Restore':
  283.     part                   pt  = Restore partition table
  284.     boot                   bo  = Restore bootsector of HD
  285.     cmos                   cm  = Restore CMOS
  286.  
  287.    2.3.1.  immunize (im)
  288.  
  289.     This option requires an additional parameter specifying the drive
  290.     to process. You can specify the hard disk as well as diskette
  291.     drives.
  292.  
  293.     Effect of option 'immunize' on the hard disk (immunize C:)
  294.  
  295.     This is a very powerful option, it can be used to clean an
  296.     infected partition table if there is no TbUtil data file, and it
  297.     replaces the existing partition table code by a new partition
  298.  
  299.  
  300.  
  301.                                      Page 4
  302.  
  303.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  304.  
  305.  
  306.     routine that has some virus detection capabilities. The original
  307.     partition code will be saved in a file. You have to run TbUtil
  308.     from a floppy drive or you have to specify the name of the file
  309.     (the specified drive should be a diskette drive) to store the
  310.     original partition code. For more information about the
  311.     new partition code see the next chapter.
  312.  
  313.     If the original partition table is completely damaged and can not
  314.     be used to built a new one, TbUtil will search the entire disk for
  315.     information about the original disk layout. TbUtil will also search
  316.     for TbUtil data files on the hard disk. It is however recommended
  317.     to store the data file on a diskette, but it is a good idea to keep
  318.     a copy of it on the hard disk.  Just in case!
  319.  
  320.     Effect of option 'immunize' on diskette drives.
  321.  
  322.     Option 'immunize' can be used to clean diskettes infected by a
  323.     bootsector virus. Option 'immunize' can also be used to replace the
  324.     standard bootsector by a bootsector which has advantages over the
  325.     original one:
  326.  
  327.     -   It has virus detection capabilities. The bootsector will check
  328.         that it is still located on the correct place on the diskette,
  329.         and that Int 13h and/or Int 40h are still located in system
  330.         ROM. This makes it possible to detect even 'stealth' viruses.
  331.  
  332.     -   The TBAV bootsector is able to load the system files if they
  333.         are available on the disk, but if the DOS system files are not
  334.         on the disk the TBAV bootsector will present a small menu and
  335.         offers you two possibilities: retry the boot operation with
  336.         another diskette, or to boot from the harddisk. If the user
  337.         selects the latter, it is not required to open the
  338.         diskette drive door.
  339.  
  340.    2.3.2.  store (st)
  341.  
  342.     This option stores the partition table, bootsector and CMOS data
  343.     area into the TbUtil data file.
  344.  
  345.    2.3.3.  compare (co)
  346.  
  347.     This option enables you to check that everything is still Ok.  If
  348.     you specify this option TbUtil will compare the information in
  349.     the TbUtil data file against the partition table, bootsector and
  350.     CMOS data area.  It will also show the comment stored in the data
  351.     file. And of course, if you use this option you will also be sure
  352.     that the TbUtil data file is still readable.
  353.  
  354.    2.3.4.  restore (re)
  355.  
  356.     This option enables you to restore the partition table, bootsector,
  357.     and CMOS data area. It will ask you to confirm that the data file
  358.  
  359.  
  360.  
  361.                                      Page 5
  362.  
  363.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  364.  
  365.  
  366.     belongs to the current machine. Finally it will restore the
  367.     partition table, bootsector of the partition to be used to boot,
  368.     and the CMOS data area.
  369.  
  370.    2.3.5.  norepeat (nr)
  371.  
  372.     TbUtil will prompt you for next diskette after you immunized a
  373.     diskette. With option 'norepeat' you can disable this.
  374.  
  375.    2.3.6.  description (de)
  376.  
  377.     You can add a description to a TbUtil data file, which makes it
  378.     easier to determine which data file belongs to which machine.
  379.  
  380.     Enter a meaningful description of the machine. Enter something like
  381.     "AT 12MHz, 4Mb, room 12, Mr. Smith".  You do NOT have to remember
  382.     it, TbUtil will display it on the screen when comparing or
  383.     restoring, but it helps you to verify that the data file belongs to
  384.     the machine.
  385.  
  386.     It is also possible to check the comment from the DOS command
  387.     prompt. Enter:
  388.                 Type TbUtil.Dat
  389.     This will show the comment of the TbUtil.Dat file (without any
  390.     other garbage being displayed).
  391.  
  392.     Note: if you want to include spaces within the comment, you should
  393.     surround the text by quotes (").
  394.  
  395.     Example:
  396.         TbUtil Store Descripion="AT 12 MHz, 4Mb, room 12"
  397.  
  398.    2.3.7.  part (pt)
  399.  
  400.     TbUtil will by default restore the partition code, bootsector and
  401.     CMOS if option 'restore' is specified. If you use one of the
  402.     options 'part', 'boot' or 'cmos' in combination with option
  403.     'restore' TbUtil will restore just the items specified.
  404.  
  405.    2.3.8.  boot (bo)
  406.  
  407.     TbUtil will by default restore the partition code, bootsector and
  408.     CMOS if option 'restore' is specified. If you use one of the
  409.     options 'part', 'boot' or 'cmos' in combination with option
  410.     'restore' TbUtil will restore just the items specified.
  411.  
  412.    2.3.9.  cmos (cm)
  413.  
  414.     TbUtil will by default restore the partition code, bootsector and
  415.     CMOS if option 'restore' is specified. If you use one of the
  416.     options 'part', 'boot' or 'cmos' in combination with option
  417.     'restore' TbUtil will restore just the items specified.
  418.  
  419.  
  420.  
  421.                                      Page 6
  422.  
  423.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  424.  
  425.  
  426.  
  427.   2.4.  Examples:
  428.  
  429.         TbUtil store
  430.  
  431.         TbUtil st
  432.  
  433.         TbUtil store A:TbUtil.Dat
  434.  
  435.         TbUtil store A:TbUtil.Dat description = "Test machine"
  436.  
  437.         TbUtil compare A:TbUtil.Dat
  438.  
  439.         TbUtil restore A:TbUtil.Dat part cmos
  440.  
  441.         TbUtil immunize A:
  442.  
  443.         Type A:TbUtil.Dat
  444.  
  445.  
  446.   2.5.  Using the anti-virus partition.
  447.  
  448.     If you install the Thunderbyte partition code (TbUtil immunize),
  449.     you will see the following while booting a clean system:
  450.  
  451.         Thunderbyte anti-virus partition v5.00 (C) 1992 Thunderbyte BV.
  452.  
  453.         Checking bootsector CRC -> OK!
  454.         Checking available RAM -> OK!
  455.         Checking INT 13h -> OK!
  456.  
  457.     If there is a virus in the bootsector or partition table you will
  458.     see this:
  459.  
  460.         Thunderbyte anti-virus partition v5.00 (C) 1992 Thunderbyte BV.
  461.  
  462.         Checking bootsector CRC -> OK!
  463.         Checking available RAM -> Failed!
  464.  
  465.         System might be infected. Continue? (N/Y)
  466.  
  467.     If your system configuration changes, i.e. you update your DOS
  468.     version, or change the amount of memory, you need to update the
  469.     information stored in the immune partition too. You can do this
  470.     with the command "TbUtil immunize c:".
  471.  
  472.     Some other messages that can be displayed are "No system.", which
  473.     means that there is no active partition on the disk, and "Disk
  474.     error" which meaning is obvious.
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.                                      Page 7
  482.  
  483.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  484.  
  485.  
  486. 3.  THE THUNDERBYTE PARTITION CODE.
  487.  
  488.  
  489.   3.1.  What is a partition?
  490.  
  491.     A partition is a logical drive on a hard disk. One physical hard
  492.     disk can contain mulitple DOS partitions. Every DOS partition has
  493.     its own drive ID (C: D: E:).
  494.  
  495.  
  496.   3.2.  What is a partition table?
  497.  
  498.     How does the system know about the disk lay-out? How does the
  499.     system know where a partition starts and ends?
  500.     This is defined by the partition table. The partition table contains
  501.     the start and end cylinder of every partition. The partition table
  502.     also carries information about the operating system of a partition
  503.     and which partition should be used to boot. The partition table is
  504.     always located at the first sector of the hard disk. It is called
  505.     the "Master Boot Record".
  506.  
  507.  
  508.   3.3.  The partition code
  509.  
  510.     The first sector of the hard disk contains the partition table, but
  511.     it also contains a piece of code. This code will be called by the
  512.     BIOS boot-routine of the machine. It is the first piece of non-BIOS
  513.     code that will be executed. The partition code normally interprets
  514.     the partition table, and determines which partition should be used
  515.     to boot. It reads the bootsector of the bootable partition and
  516.     transfers control to it. The bootsector invokes the DOS hidden
  517.     files and the system fires up.
  518.  
  519.     Since the partition code does not do very much and is a very small
  520.     routine (about 80 bytes) you will never notice that it is there and
  521.     is executed every time you boot.
  522.  
  523.     However, there are some viruses which overwrite the existing
  524.     partition table or bootsector, and while performing the normal boot
  525.     procedure, the code remains resident in memory and infects every
  526.     diskette. When there is a virus in a file, you can easily get rid
  527.     of the virus by deleting the infected file. However, the partition
  528.     table can not be deleted, and the only thing a user can do is to
  529.     low-level format the hard disk and to re-partition it, take their
  530.     chances with undocumented DOS commands, or to use TbUtil (or a
  531.     similar product) to restore the original partition table.
  532.  
  533.     Anyway, it is often difficult to detect a partition or
  534.     bootsector virus, since the virus is already resident in memory
  535.     when DOS and eventually an anti-virus product fires up. Like any
  536.     other memory resident program, a virus can do anything. The virus
  537.     intercepts the BIOS calls, and if an anti-virus product (a scanner
  538.  
  539.  
  540.  
  541.                                      Page 8
  542.  
  543.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  544.  
  545.  
  546.     or checksummer) wants to read the bootsector in order to inspect
  547.     it, the virus intercepts the BIOS request, and supplies the program
  548.     with an unaltered copy of the original bootsector stored somewhere
  549.     on the disk, instead of the infected bootsector. This means that a
  550.     well-designed bootsector virus can hide itself completely from
  551.     anti-virus products. To detect the virus, you have to be sure the
  552.     virus is not resident in memory. There are only two possibilities
  553.     to achieve this:
  554.  
  555.     -   By booting from a clean DOS diskette (the virus is not executed
  556.         and not resident in memory and can not prevent the anti-virus
  557.         program to read it)
  558.  
  559.     -   By executing a piece of software that is executed before the
  560.         bootsector gains control. The only software that is executed
  561.         before the bootsector gains control is the machine BIOS and
  562.         additional hardware (like Thunderbyte) and the partition code...
  563.  
  564.     Except for hardware immunizers (like Thunderbyte) only the
  565.     partition code will be executed before the bootsector gains
  566.     control, so only a routine in the partition code can safely check
  567.     the bootsector while booting from the harddisk.
  568.  
  569.     This consideration has lead to the development of the Thunderbyte
  570.     anti-virus partition code. The Thunderbyte anti-virus code performs
  571.     the normal tasks of the partition code, but it also has some
  572.     additional routines, which check the CRC (a sophisticated sort of
  573.     checksum) of the bootsector, the amount of free RAM, and the
  574.     location of the INT 13h handler.
  575.  
  576.     Smart users will have noticed that we changed our subject from
  577.     partition viruses to bootsector viruses. The bootsector can be
  578.     checked completely by the partition code, but how about the
  579.     partition code itself? The answer is that it is not possible to
  580.     check the partition code accurately. This can only be done by
  581.     hardware like the Thunderbyte add-on card. However, we have
  582.     built-in some additional tools to detect partition table viruses.
  583.     To know how they work additional information about partition
  584.     viruses is required.
  585.  
  586.     A partition virus that wants to hide itself has to remain resident
  587.     in memory and has to intercept all attempts to read the partition
  588.     code. Since the partition code is normally removed from memory as
  589.     soon as DOS fires up, the partition virus has to 1) allocate some
  590.     memory to remain resident. The virus also has to intercept all
  591.     requests to read the partition code in order to hide itself, so it
  592.     has to 2) hook the BIOS INT 13h call. After the virus is memory
  593.     resident, the virus reads the original partition code and transfers
  594.     control to it. For the user nothing has changed...
  595.  
  596.     When installing the Thunderbyte partition code, TbUtil determines
  597.     the amount of RAM at system startup and it calculates the CRC of
  598.  
  599.  
  600.  
  601.                                      Page 9
  602.  
  603.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  604.  
  605.  
  606.     the bootsector of the bootable harddisk partition. Both values are
  607.     stored in the partition code.
  608.  
  609.     If there is a virus in the bootsector the CRC does not match
  610.     anymore, and the partition code will notify the user of this. If
  611.     the partition code has been overwritten by a virus, and the virus
  612.     has installed itself in memory before invoking the Thunderbyte
  613.     partition code, the amount of available RAM has been decreased.
  614.     The Thunderbyte partition code will notify the user about the
  615.     unexepected RAM decrease. Finally, the partition code will check
  616.     whether INT 13h points to ROM or RAM. Usually, the partition code
  617.     is the first piece of software being executed, so INT 13h should
  618.     point to ROM. If it points to RAM it means that another piece of
  619.     software has been executed before the Thunderbyte partition gained
  620.     control, and it is likely that it is a virus. If the virus did not
  621.     hook INT 13h, it would be possible to detect the virus with a
  622.     normal virus scanner or checksummer. Anyway, if INT 13h points to
  623.     RAM, the Thunderbyte partition code will notify the user of this.
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.                                     Page 10
  662.  
  663.  TbUtil anti virus tool. (C) Copyright 1988-1993 Thunderbyte B.V.
  664.  
  665.  
  666. 4.  MISCELLANOUS INFORMATION
  667.  
  668.  
  669.   4.1.  Exit codes
  670.  
  671.     TbUtil terminates with one of the following exit codes:
  672.         Errorlevel 1 when option 'compare' fails or an error occurs.
  673.         Errorlevel 0 when everything was okay.
  674.  
  675.  
  676.   4.2.  Recommendations
  677.  
  678.     Since the PC is completely inaccessable to DOS if the partition
  679.     table gets damaged, it is HIGHLY RECOMMENDED to store both the
  680.     TbUtil data file and the program TbUtil.Exe itself on a diskette!
  681.     It is not nice if the partition table is destroyed, and the only
  682.     solution to the problem resides on the same inaccessable disk...
  683.  
  684.     If you own more than one PC, create one TbUtil diskette with all
  685.     TbUtil data files of all your PC's on it.  Just execute "TbUtil
  686.     store = a:TbUtil.<number>" on every PC's.  The number specifies
  687.     the number (or even name) of the PC.
  688.  
  689.     Do NOT automatically invoke TbUtil from within the autoexec.bat
  690.     file with the 'store' option set. If you do this, the data file will
  691.     be overwritten by the virus immediately after the disk gets
  692.     infected.
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.                                     Page 11